package com.xxh.dasongapp.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xxh.dasongapp.common.entity.User;
import com.xxh.dasongapp.common.vo.UserVo;
import com.xxh.dasongapp.service.common.IBaseService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


public interface UserService extends IBaseService<User> {
    @Transactional(rollbackFor = {Exception.class})
    Boolean saveUserAndRole(User user,Integer roleId);

    @Transactional(rollbackFor = {Exception.class})
    Boolean saveOrUpdateUserAndRole(User user,Integer roleId);

    @Transactional(rollbackFor = {Exception.class})
    Boolean removeUserAndRoleById(String id);

    Page getUserAndRoleByPage(Page page, QueryWrapper<UserVo> queryWrapper);

    UserVo getUserAndRoleById(String id);

    UserVo getUserAndRoleByUsername(String username);


    User getByOpenId(String openId);

    User getByUsername(String username);

}
